﻿<div id="addEditItems" class="popup-wrapper" style="display: none;">
    <div class="popup-content">
        <h4>Thêm các mục cho trường dữ liệu</h4>
        <div class="row" style="text-align:left">        
            <label>Tiêu đề:</label>
            <input type="hidden" id="ItemId" name="ItemId" data-bind="value: ItemId" />
            <input type="text" class="text" name="itemTitle" id="ItemTitle" data-bind="value: ItemTitle" />

            <a href="javascript:closePopup();" class="btn btn-cancel-small right">cancel</a>
            <a href="javascript:void(0)" class="btn btn-submit-small right" data-bind="click: AddItems">submit</a>

        </div>
        <div class="row" style="margin-top:10px" data-bind="visible: ItemList().length> 0">
            <table class="tablegrid" cellpadding="0" cellspacing="0">
                <thead>
                    <tr class="title">
                        <th class="active">Thứ tự</th>
                        <th class="active">Sắp xếp</th>
                        <th>Tên</th>
                        <th class="last centeralign">Lựa chọn</th>
                    </tr>
                </thead>
                <tbody data-bind="foreach: ItemList">
                    <tr>
                        <td><span class="w" data-bind="text: OrderId"></span></td>
                        <td>
                             <span class="w">
                                <a href="javascript:void(0)" class="item_arrow_down" title="Down" data-bind="attr: {rel: 'item' + Id, 'class': $index() < ($parent.ItemList().length - 1)? 'item_arrow_down': 'item_arrow_down_off'}, click: $parent.UpdateItemDown"></a>
                                <a href="javascript:void(0)" class="item_arrow_up" title="Up" data-bind="attr: {rel: 'item' + Id, 'class': $index() > 0? 'item_arrow_up': 'item_arrow_up_off'}, click: $parent.UpdateItemUp"></a>
                            </span>
                        </td>
                        <td><span class="w" data-bind="text: Title"></span></td>
                        <td class="last centeralign">
                            <span class="w">
                                <a class="delete" data-bind="attr: {rel: 'item' + Id, title: Title}, click: $parent.DeleteItem" href="javascript:void(0)">Xóa</a>
                            </span>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
